package oj;

/**
 * @author 郝文雪
 * @date 2022/8/11 23:55
 * @Description Test
 */
public class LC509 {
    public int fib(int n) {
        if(n==0) return 0;
        int fib1=1;
        int fib2=1;
        int fib3=0;
        for(int i=3;i<=n;i++){
            fib3=fib1+fib2;
            fib1=fib2;
            fib2=fib3;
        }
        return fib2;
    }
}
